<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Edit Server</title>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
    <style>
      body {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh; /* Full viewport height */
        margin: 0;
        font-family: Arial, sans-serif;
        background-color: #f4f4f9; /* Light background color for better contrast */
      }
      .form-container {
        text-align: left;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        background-color: #fff;
        width: 350px; /* Set a specific width for the form container */
      }
      .button-container {
        display: flex;
        justify-content: center; /* Center the buttons */
        margin-top: 20px; /* Add some top margin for spacing */
      }
      .button-container button {
        padding: 10px 20px; /* Add some padding to the buttons */
        font-size: 16px; /* Set font size */
        margin: 0 5px; /* Reduce horizontal margin between buttons */
      }
      label {
        display: block;
        margin-bottom: 5px;
      }
      input[type="text"],
      input[type="password"] {
        width: calc(100% - 24px); /* Adjust width to account for padding and border */
        padding: 8px;
        margin-bottom: 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
      }
    </style>
  </head>
  <body>
    <div class="form-container">
      <h1>Edit Server</h1>
      <form method="POST">
        <label for="hostname">Hostname:</label>
        <input type="text" id="hostname" name="hostname" value="{{ server.hostname }}" required><br>
        <label for="bmc_ip">BMC IP:</label>
        <input type="text" id="bmc_ip" name="bmc_ip" value="{{ server.bmc_ip }}" required><br>
        <label for="username">Username:</label>
        <input type="text" id="username" name="username" value="{{ server.username }}" required><br>
        <label for="password">Password:</label>
        <input type="password" id="password" name="password" value="{{ server.password }}" required><br> <!-- Changed to password field -->
        <label for="use_lanplus">Use LAN Plus:</label>
        <input type="checkbox" id="use_lanplus" name="use_lanplus" {% if server.use_lanplus %}checked{% endif %}><br>
        <div class="button-container">
          <button type="submit">Update Server</button>
          <a href="{{ url_for('index') }}" style="text-decoration: none;">
            <button type="button">Back to Home</button>
          </a>
        </div>
      </form>
    </div>
  </body>
</html>
